<?php
/**
 * @Notes:【】
 * @Date: 2022-06-16 23:14
 */

namespace App\WsService\Message;

use App\Constants\ChatEvent;
use App\Dao\Chat\ChatRecordsDao;
use App\Model\Chat\ChatRecords;
use Hyperf\Di\Annotation\Inject;

class ChatService extends BaseService
{

    /**
     * @Inject()
     * @var ChatRecordsDao
     */
    protected $chatRecordsDao;

    public function SendUnReadNum($userId)
    {
        $unReadNum = $this->chatRecordsDao->getUnReadNum($userId);

        $this->sendUser($userId, ChatEvent::UN_READ_TOTAL_NUM, $unReadNum);
    }
}